﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>GroupAdminInfoForm</title>
</head>
<body>
<form id="formx" name="formx" method="post" enctype="multipart/form-data">
<div class="easyui-layout" data-options="fit:true,">
    <div data-options="region:'north',split:false," style="height: 34px; overflow: hidden;">
        <div style="float: left;">
            <a id="btnSave" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true,">保存</a>
            <a id="btnRefresh" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-refresh',plain:true,">刷新</a>
            <a id="btnHelp" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-help',plain:true,">帮助</a>
            <a id="btnClose" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-no',plain:true,">关闭</a>
        </div>
        <div style="float: right; padding: 2px 1px 0px 2px;">
            <input class="easyui-searchbox" data-options="prompt:'关键字'" style="width: 150px" />
        </div>
    </div>
    <div data-options="region:'center',split:true," style="padding: 1px; overflow: hidden;">
        <div class="easyui-layout" data-options="fit:true,">
            <div data-options="region:'west',split:true," style="padding: 1px; width: 40%; overflow: hidden;">
                <div class="easyui-layout" data-options="fit:true,">
                    <div data-options="region:'north',split:false," style="height: 100px; padding: 1px; overflow: hidden;">
                        <div style="margin: 1px 0px 1px 0px; text-align: center;">
                            <div class="rows2"><div class="left line-height-normal">主 标 题：</div><div class="right"><div id="Title" style="width: 100%; height: 32px;"></div></div></div>
                            <div class="rows2"><div class="left line-height-normal">留言时间：</div><div class="right" style="padding-top: 6px;"><div id="DateTimeCreate"></div></div></div>
                        </div>
                    </div>
                    <div data-options="region:'center',split:true," style="padding: 12px; overflow-x: hidden; overflow-y: scroll; background: #c0c0c0;">
                        <div style="width: 90%; font-size: 12px; background: #ffffff; margin: 0 auto; padding: 0px;">
                            <div id="Content" style="width: 100%; height: 320px;"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div data-options="region:'center',split:false," style="padding: 1px; width: 60%; overflow: hidden;">
                <div class="easyui-layout" data-options="fit:true,">
                    <div data-options="region:'north',split:false," style="height: 100px; padding: 1px; overflow: hidden;">
                        <div class="rows2"><div class="left line-height-normal">回复标题：</div><div class="right"><input id="TitleExt" name="TitleExt" class="easyui-textbox" style="width: 100%; height: 32px;" type="text" data-options="required:false,multiline:true,prompt:'主标题'," /></div></div>
                        <div class="rows2"><div class="left line-height-normal">审核通过：</div><div class="right" style="padding-top: 6px;"><input type="checkbox" value="1" id="FlagPass" name="FlagPass" />是</div></div>
                        <div class="rows2"><div class="left line-height-normal">是否显示：</div><div class="right" style="padding-top: 6px;"><input type="checkbox" value="1" id="FlagView" name="FlagView" />是</div></div>
                    </div>
                    <div data-options="region:'center',split:true," style="padding: 12px; overflow-x: hidden; overflow-y: scroll; background: #c0c0c0;">
                        <textarea id="ContentExt" name="ContentExt" style="width: 100%; height: 320px;"></textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</form>
<script type="text/javascript">
    $(function () {
        window.xbase.logonNo(); // 访问本页面，如已登录则跳转到index.html。
        window.xbase.closeDialog('#btnClose', '#dialog1');
        window.xbase.openDialog('#btnHelp', '#dialog2');
        var action = $('#Action').val();
        var datas = 'url=' + window.location.pathname + '&rnd=' + Math.random();
        switch (action) {
            case 'ActNew':
                break;
            default:
                datas = "id=" + $('#datagrid1').datagrid('getSelected').PkId + '&' + datas;
                break;
        }
        //'nodeid=' + $('#datagrid1').datagrid('getSelected').NodeId + 
        $.ajax({
            url: '/Ashx/Acc/Staff/GroupAdminInfoView.ashx?action=ActView&' + datas,
            data: datas,
            method: 'POST',
            success: function (result) {
                if (result != null && result != '') {
                    var json = window.xbase.json(result);
                    $('#formx').form('load', json);
                    $('#Title').html(json.Title);
                    $('#Content').html(json.Content);
                    $('#DateTimeCreate').html(window.xbase.FormatDateTime(json.DateTimeCreate));
                    KindEditor.html('#ContentExt', json.Content);
                }
            },
        });
        $('#btnSave').click(function () {
            $('#formx').form('submit', {
                url: '/Ashx/Acc/Staff/GroupAdminInfoForm.ashx?action=' + action + '&' + datas,
                //async: false,
                dataType: 'json',
                data: datas,
                success: function (result) {
                    if (!(result != null && result != '')) return window.xbase.return('系统错误', 'Ajax返回空值，请稍后重试！<br />ps:如果您使用了360浏览器，请换之！', 'error');
                    var json = window.xbase.json(result);
                    if (json.error == 0) $("#datagrid1").datagrid('reload');
                    $.messager.alert('提示信息', json.message.m_StringValue, 'info');
                    $('#dialog1').dialog('close');
                }
            });
        });
        editorBuilder('Content'); //在使用编辑前就要生成。
        function editorBuilder(content) {
            $.getScript('/ker/kindeditor-min.js', function () {
                if (!KindEditor) throw "KindEditor is not defined!!!";
                KindEditor.basePath = '/ker/';
                KindEditor.remove('textarea[name="' + content + '"]');
                KindEditor.create('textarea[name="' + content + '"]', {
                    width: '100%',
                    bodyClass: 'ke-content-ext',
                    themeType: 'simple',
                    langType: 'zh_CN', // this.value,
                    urlType: 'absolute', //relative|absolute|domain
                    uploadJson: '/ashx/app/UploadFiles.ashx',
                    fileManagerJson: '/ashx/app/UploadFilesBrowser.ashx',
                    allowFileManager: true,
                    autoHeightMode: true,
                    afterCreate: function () {
                        this.loadPlugin('autoheight');
                    },
                    afterBlur: function () { this.sync(); },
                    afterChange: function () //输入文字事件
                    {
                        //1.判断是否是IE，并获取内容高度 //2.设置高度
                        this.edit.setHeight(KindEditor.IE ? this.edit.doc.body.scrollHeight : this.edit.doc.body.offsetHeight);
                    }
                });
            });
        }
    });
</script>
</body>
</html>
